package com.xiaohao.student_course.controller;

import com.xiaohao.student_course.bean.User;
import com.xiaohao.student_course.service.UserSevice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created with IntelliJ IDEA.
 *
 * @author 小浩
 * @date 2018-12-15 17:03
 * @package com.xiaohao.student_course.controller
 * @description
 */
@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserSevice userSevice;
    //登录
    @RequestMapping("/login")
    public boolean userLogin(String name,String password){
        User userByName = userSevice.findUserByName(name);
        return password.equals(userByName.getPassword());
    }
}
